<?php
class Layout_View_Helper_BreadcrumbRenderer extends Zend_View_Helper_Abstract {
	private $_breadcrumbHelper;

	private function _setBreadcrumbHelper() {
		$this->_breadcrumbHelper = $this->view->getHelper('navigation')->navigation()->breadcrumbs();
	}

	private function _getBreadcrumbHelper() {
		if($this->_breadcrumbHelper instanceof Zend_View_Helper_Navigation_Menu === false) {
			$this->_setBreadcrumbHelper();
		}
		return $this->_breadcrumbHelper;
	}

	public function BreadcrumbRenderer() {
		$menu			= $this->_getBreadcrumbHelper()->findBy('uri', '/');
		$partial 	= array('breadcrumb.phtml', 'default');

		return $this->_getBreadcrumbHelper()
			->setRenderInvisible(true)
			->renderPartial($menu, array('breadcrumb.phtml', 'default'));
	}
}
?>
